<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<title>菜单管理</title>
<link rel="stylesheet" type="text/css" href="../style/system.css">
<script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" data-main="../js/employee_department_main" src="../js/require.js"></script>
<script>
function findInArr(arr,sClass){
	for(var i=0;i<arr.length;i++){
		if(arr[i]==sClass){
			return true;
		}
	}
	return false;
}
function getByClass(obj,sClass){
	var aResult = [];
	if(obj.getElementsByClassName){
		aResult = obj.getElementsByClassName(sClass);
	}else{
		var aEle = obj.getElementsByTagName('*');
		for(var i=0;i<aEle.length;i++){
			var aClass = aEle[i].className.split(' ');
			if(findInArr(aClass,sClass)){
				aResult.push(aEle[i]);
			}
		}
	}
	return aResult;
}
$(function () {

	
//    $(".department_btn").click(function () {
//        $(".depart_ment_box,.shadow").css("display", "block");
//
//    });
//	$(".department_x").click(function () {
//        $(".depart_ment_box,.shadow").css("display", "none");
//
//    });
//
//
//	$(".depart_btn").click(function () {
//        $(".depart_box,#shadow").css("display", "block");
//
//    });
//	$(".depart_cancel").click(function () {
//        $(".depart_box,#shadow").css("display", "none");
//
//    });

	$('#add_btn_chat').click(function(){
		if (confirm("本次同步包括2个部门，10个员工，确定同步吗？")) {
		$('.shadow_chat').css('display','block');
		$('.shadow_chat_content').css('display','block');
		window.setTimeout(sychronToChat,2000);
		$('#chat_content').html("正在准备数据..."); }
	});

	

	
});

//function stopdiv(){
//	$('.shadow_chat').css('display','none');
//	$('.shadow_chat_content').css('display','none');
//}


	


//function sychronToChat(){
//	$('#chat_content').html("开始同步...");
//	window.setTimeout(stopdiv,2000);
//}


window.onload=function(){
	var system_Tab = document.getElementById('system_tab_til');
	var system_Li = system_Tab.getElementsByTagName('li');
	var system_Tab = document.getElementById('system_tab');
	var system_Tab_cont = getByClass(system_Tab,'system_tab_cont');
	for(var i=0;i<system_Li.length;i++){
		(function (index){
			system_Li[index].onclick=function(){
				for(var i=0;i<system_Li.length;i++){
					system_Li[i].className='';
					system_Tab_cont[i].style.display='none';
				}
				this.className='on';
				system_Tab_cont[index].style.display='block';
			};
		})(i);
	}

};

function menuFix() {
 var obj = document.getElementById("nav").getElementsByTagName("li");

 for (var i=0; i<obj.length; i++) {
  obj[i].onmouseover=function() {
   this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  obj[i].onMouseDown=function() {
   this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  obj[i].onMouseUp=function() {
   this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  obj[i].onmouseout=function() {
   this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
  }
 }
}
function DoMenu(emid)
{
 var obj = document.getElementById(emid);
 obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
 if((LastLeftID!="")&&(emid!=LastLeftID)) //关闭上一个Menu
 {
  document.getElementById(LastLeftID).className = "collapsed";
 }
 LastLeftID = emid;
}
function GetMenuID()
{
 var MenuID="";
 var _paramStr = new String(window.location.href);
 var _sharpPos = _paramStr.indexOf("#");

 if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)
 {
  _paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
 }
 else
 {
  _paramStr = "";
 }

 if (_paramStr.length > 0)
 {
  var _paramArr = _paramStr.split("&");
  if (_paramArr.length>0)
  {
   var _paramKeyVal = _paramArr[0].split("=");
   if (_paramKeyVal.length>0)
   {
    MenuID = _paramKeyVal[1];
   }
  }
  /*
  if (_paramArr.length>0)
  {
   var _arr = new Array(_paramArr.length);
  }

  //取所有#后面的，菜单只需用到Menu
  //for (var i = 0; i < _paramArr.length; i++)
  {
   var _paramKeyVal = _paramArr[i].split('=');

   if (_paramKeyVal.length>0)
   {
    _arr[_paramKeyVal[0]] = _paramKeyVal[1];
   }
  }
  */
 }
 if(MenuID!="")
 {
  DoMenu(MenuID)
 }
}

GetMenuID(); //*这两个function的顺序要注意一下，不然在Firefox里GetMenuID()不起效果
menuFix();

</script>
</head>

<body>
<div class="tab_cont clearfix">
	<div id="left_menu"></div>
    <div class="cont_ri" id="ri_cont">
    	<div class="system_box">
        	<h3>总部 > 销售拓展中心 > 长沙分部</h3>
            <div class="system_box_cont" id="system_box_cont">
                <div class="condition clearfix">
                    <button id="add_btn">新增</button>
                    <button id="add_btn_chat"><img src="../images/icon2.png" />同步</button>
                    <input type="text" placeholder="员工ID、姓名" class="place_txt" />
                    <input type="text" placeholder="部门ID、名称" class="place_txt" />
                    <label>状态 <select>
                        <option></option>
                        <option>状态1</option>
                        <option>状态2</option>
                    </select></label>
                    <button>搜索</button>
                </div>


                <table cellpadding="0" cellspacing="0" border="0" class="order_box" id="order_tab1">
                    <tr height="50">
                        <th><input id="depart_check" type="checkbox" /></th>
                        <th>ID</th>
                        <th>名称</th>
                        <th>角色/级别</th>
                        <th>状态</th>
                        <th>手机</th>
                        <th class="td_last">邮件</th>
                    </tr>
                    <tr height="45">
                        <td colspan="7" class="td_last upward">向上 <span>注销</span></td>
                    </tr>
                    <tr height="45">
                        <td><input type="checkbox" /></td>
                        <td>301</td>
                        <td class="img_td"><img src="../images/team.png" /> 长沙一店</td>
                        <td>门店</td>
                        <td></td>
                        <td></td>
                        <td class="td_last"></td>
                    </tr>
                    <tr height="45">
                    	<td><input type="checkbox" /></td>
                        <td>401</td>
                        <td class="img_td"><img src="../images/team.png" /> 团队1</td>
                        <td>团队</td>
                        <td></td>
                        <td></td>
                        <td class="td_last"></td>
                    </tr>
                </table>
                <table cellpadding="0" cellspacing="0" border="0" class="order_box" id="order_tab2">
                    <tr height="50">
                        <th><input id="emp_check" type="checkbox" /></th>
                        <th>ID</th>
                        <th>名称</th>
                        <th>角色/级别</th>
                        <th>状态</th>
                        <th>手机</th>
                        <th class="td_last">邮件</th>
                    </tr>
                    <tr height="45">
                    	<td><input type="checkbox" /></td>
                        <td>301120</td>
                        <td class="department_btn">张XX</td>
                        <td>客服</td>
                        <td>在职</td>
                        <td>135********</td>
                        <td class="td_last">123456789@qq.com</td>
                    </tr>
                </table>



                <p class="fund_page clearfix">
                    <span><a class="h_bg_width" href="#">首页</a>
                    <a href="#"><i class="h_icon_prev"></i></a>
                    <a class="current" href="#">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                    <a href="#">4</a>
                    <a href="#">5</a>
                    <a href="#"><i class="h_icon_next"></i></a>
                    <a class="h_bg_width" href="#">末页</a></span>
                </p>
            </div>
            <div class="system_tab" id="system_tab" style="z-index: 1;top: -350px;">
            	<ul id="system_tab_til" class="clearfix">
                	<li class="on">员工</li>
                    <li>部门</li>
                </ul>




                <div class="system_tab_cont" style="display:block;">
                        <table cellpadding="0" cellspacing="0" border="0" width="698" class="system_table">
                            <tr height="45">
                                <td><label>姓名：</label> <input class="empName" name="empName" id="empName" type="text" /></td>
                                <td><label>身份证号：</label><input name="idCardNo" id="idCardNo" class="idCardNo" type="text" maxlength="18"/></td>
                            </tr>
                            <tr height="45">
                                <td><label>电话：</label> <input id="mobile" name="mobile" class="mobile" type="text" maxlength="11"/></td>
                                <td><label>邮箱：</label> <input id="email" name="email" class="email" type="text" /></td>
                            </tr>
                            <tr height="45">
                                <td><label>性别：</label>
                                    <select id="gender" name="weixinGender"></select>
                                </td>
                                <td><label>状态：</label>
                                    <select id="empStatus" name="empStatus"></select>
                                </td>
                            </tr>
                            <tr height="45">
                                <td><label>角色：</label> <input class="roleNames" id="roleNames" type="text" readonly="readonly"/><button class="role_btn" type="button">...</button></td>
                                <td><label>部门：</label> <input class="depName" id="depName" type="text" readonly="readonly"/><button class="depart_btn" type="button">...</button></td>
                            </tr>
                            <tr height="45">
                                <td><label>口令：</label> <input name="password"  type="text" id="password" /></td>
                                <td><label>再次输入：</label><input name="re_password"  type="text" id="re_password" /></td>
                            </tr>
                            <input type="hidden" name="currentDepId" class="currentDepId" id="currentDepId" value="" />
                            <input type="hidden" id="roleIds" value="" name="roleIds">
                            <input type="hidden" id="depChangeId" value="" name="depChangeId">
                        </table>
                    <p class="depart_p" id="depart_p">
                        <a href="#" title="点击取消" id="cancleEmployee">取消</a><button id="addEmployee"  type="button">新增</button>
                    </p>

                    <div class="role_box" id="role_box">
                        <table cellpadding="0" cellspacing="0" border="0" width="350">
                            <tbody class="objList">
                                <tr height="35">
                                    <td align="center" width="80"><input type="checkbox" class="roleIdChk" /></td>
                                    <td align="center" width="80" class="roleId"></td>
                                    <td style="padding-left:15px; border-right:none;" class="roleName"></td>
                                </tr>
                            </tbody>
                        </table>
                        <p><a href="#" class="cancle"  id="role_giveup">取消</a><button id="add_role_id" type="button">确定</button></p>
                    </div>

                    <div class="depart_box" id="depart_box">
                        <ul class="depart_box_ul">
                        </ul>
                        <p>
                            <a href="#" class="depart_cancel cancle" id="depart_cancel">取消</a>
                            <button onclick="departChange()">确定</button>
                        </p>
                    </div>
                </div>



                <div class="system_tab_cont">
                	<table cellpadding="0" cellspacing="0" border="0" width="698" class="system_table">
                    	<tr height="45">
                        	<td><label>名称：</label> <input type="text" /></td>
                            <td><label>ID：</label> <input type="text" /></td>
                        </tr>
                        <tr height="45">
                        	<td colspan="2"><label>地址：</label> 
                            	<select>
                                	<option></option>
                                    <option>河北</option>
                                    <option>江苏</option>
                                </select> 省
                                <select>
                                	<option></option>
                                    <option>唐山</option>
                                    <option>石家庄</option>
                                </select> 市
                                <select>
                                	<option></option>
                                    <option>路南区</option>
                                    <option>丰润区</option>
                                </select> 区
                            
                            </td>
                        </tr>
                        <tr height="45">
                        	<td colspan="2"><input class="big_width" type="text" /></td>
                        </tr>
                        <tr height="45">
                        	<td><label>电话1：</label> <input type="text" /></td>
                            <td><label>电话2：</label> <input type="text" /></td>
                        </tr>
                        <tr height="45">
                        	<td><label>负责人：</label> <input type="text" /></td>
                            <td></td>
                        </tr>
                    </table>
                    <h5><button>新增</button></h5>
                </div>
            
            
            </div>
        </div>
    </div>
</div>

<!--<div class="shadow"></div>-->
<!--<div class="depart_ment_box">-->
	<!--<h3><span class="department_x"><img src="../images/x.png" /></span></h3>-->
    <!--<table cellpadding="0" cellspacing="0" border="0" width="698" class="system_table">-->
        <!--<tr height="45">-->
            <!--<td><label>姓名：</label> 张三</td>-->
            <!--<td><label>ID：</label> 2015001001</td>-->
        <!--</tr>-->
        <!--<tr height="45">-->
            <!--<td><label>身份证号：</label> 123456789456321478</td>-->
            <!--<td><label>电话：</label> <input type="text" /></td>-->
        <!--</tr>-->
        <!--<tr height="45">-->
            <!--<td><label>角色：</label> <input type="text" /><button class="role_btn">...</button></td>-->
            <!--<td><label>部门：</label> <input type="text" /><button class="depart_btn">...</button></td>-->
        <!--</tr>-->
        <!--<tr height="45">-->
            <!--<td><label>邮件：</label> <input type="text" /></td>-->
            <!--<td><label>状态：</label> -->
            	<!--<select>-->
                	<!--<option></option>-->
                    <!--<option>已离职</option>-->
                    <!--<option>在职</option>-->
                    <!--<option>休假</option>-->
                <!--</select>-->
            <!--</td>-->
        <!--</tr>-->
    <!--</table>-->
    <!--<p class="depart_p">-->
    	<!--<button>保存</button>-->
        <!--<span class="depart_dw"><button>重置密码</button> <i>密码已重置为000000</i></span>-->
    <!--</p>-->

<!--</div>-->


<div class="shadow_chat"><img src="../images/loading1.gif" /></div>
<div class="shadow_chat_content">
	<font id="chat_content" style="font-size: 16px;">dgsdfgasdfgasdfasdf</font>
</div>


<div id="shadow"></div>
<div id="shadow_img"></div>

</body>
</html>
